package com.example.demo.service;

import com.example.demo.entity.ArticleInfo;
import com.example.demo.mapper.ArticleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author：徐志荣
 * @Date：2023/6/28 下午 6:23
 */

@Service
public class ArticleService {

    @Resource
    private ArticleMapper articleMapper;
    public int getArtCountByUid(Integer uid){
        return articleMapper.getArtCountByUid(uid);
    }

    public List<ArticleInfo> getMyList(Integer uid){
        return articleMapper.getMyList(uid);
    }

    public int del(Integer id,Integer uid){
        return articleMapper.del(id,uid);
    }

    public  ArticleInfo getDetail(Integer id){
        return articleMapper.getDetail(id);
    }

    public int incrRCount(Integer id){
        return articleMapper.incrRCount(id);
    }

    public int add(ArticleInfo articleInfo){
        return articleMapper.add(articleInfo);
    }

    public int update(ArticleInfo articleInfo) {
        return articleMapper.update(articleInfo);
    }
    public List<ArticleInfo> geiListByPage(Integer psize ,Integer offsetsize){
        return articleMapper.geiListByPage( psize , offsetsize);
    }
    public  int getCount(){
        return  articleMapper.getCount();
    }

}
